package descentFly.away3D4.element.Extends
{
	import UIFree.ObjectEvent;
	
	import descentFly.app.df_events;
	import descentFly.away3D4.element.df_element;
	import descentFly.data.df_fields;
	
	import flash.events.Event;
	
	public class df_tportLevelCtrl extends df_teleportController {
		public static const FIELD_ACTIVEEVENT: String = 'activeEvent';
		public function df_tportLevelCtrl(a_ctrl:df_element, a_options:Object) {
			super(a_ctrl, a_options);
		}
		
		override protected function doSetModel(e: Event): void {
			super.doSetModel(e);
			if (options[FIELD_ACTIVEEVENT]) {
				ctrl.Space.addEventListener(options[FIELD_ACTIVEEVENT], doEvent);
				ctrl.getModel().visible = false;
			}
		}
		
		override protected function removeEvents():void {
			ctrl.Space.removeEventListener(options[FIELD_ACTIVEEVENT], doEvent);
			super.removeEvents();
		}
		
		protected function doEvent(e: Event): void {
			ctrl.getModel().visible = true;
		}
	}
}